1. Field of the Invention
The present invention relates to software updates, and more particularly to a method and system for updating boot code.
2. Description of the Related Art
Recently, various portable terminals, such as mobile communication terminals, Personal Digital Assistants (PDAs), etc., have been rapidly developing. Various functions of the portable terminals have been combined and replacement periods of new models of these portable terminals have been shortened by the realization of digital convergence. As a result, the circulation of the portable terminals, which include invisible and undesired function errors occurring during realization procedures of the portable terminals, has increased. Additional functions of the portable terminals may also be released by means of code patches after the realization or start of use of the portable terminals.
In this case, software of the portable terminals purchased and in use by users, must be updated for upgrades and error correction. To this end, engineers of manufacture or service enterprises of the portable terminals must directly call on the users of the portable terminals, otherwise, the users of the portable terminals to be updated must directly call the service enterprises or After Service (A/S) centers to receive software updates for their portable terminals.
To decrease the above described inconveniences, an Over The Air-Software Download (OTA-SD) mode has been suggested for portable terminals having mobile communication function. This is a mode through which a user having a portable terminal to be updated may connect to a specific server of an A/S center via the Internet, select update files to be downloaded, and download the update files to his/her portable terminal. There is another mode through which a user may download update files to the user's Personal Computer (PC), and then download the update files to the user's portable terminal by means of a Universal Serial Bus (USB) cable.
The update of software is performed by re-booting the portable terminals after the update files are downloaded to the portable terminal in the manner described above. This software update is usually performed by storing the downloaded software code in an area corresponding to the update (hereinafter referred to as “the update area”) after the area for storing the update software code is cleared. This area for storing is located at a non-volatile memory for storing software in a portable terminal. The non-volatile memories for storing software generally employ programmable non-volatile memories, such as flash memories, in portable terminals. These non-volatile memories store boot codes as well as application programs, fonts binaries, and contents binaries.
As the software is downloaded into and updated in the portable terminal as described above, the update of the software can be stopped due to abnormal causes during the update. As an example of such an abnormal cause, the power of the terminal may be suddenly cut off by separation of a terminal battery.
The procedure of journaling can be considered for use to prevent the update process from being abnormally stopped before completion of the code update. If the procedure of journaling is employed, backup and journaling areas are allocated in the non-volatile memory, storage contents of the update area are copied into the backup area at the start of the update, and log data, which represent execution results of each step according to an update procedure, are stored in the journaling area. The update procedure comprises three steps, with a first step for copying the storage contents of the update area into the backup area, a second step for clearing the update area, and a third step for storing the software code to be updated in the update area.
The reason for copying the storage contents of the update area into the backup area is to prepare the portable terminal for an abrupt power cut-off after the clearance of the update area and to prevent software stored in the update area from being deleted without being updated. Whenever each of the three steps, including the copying step, the clearing step, and the storing step, has been completed, the log data representing execution results of each step are stored in the journaling area. Thus, when rebooting is carried out after the power is cut off in the course of the updating, a point in which the update must be restarted is checked with reference to the log data, and then the stopped update procedure can be continued from that point.
Meanwhile, when the power of the portable terminal is initially turned on, the booting is executed by the boot code stored in the boot area of the non-volatile memory as described above. Generally, the boot code plays roles of initializing basic hardware of the portable terminal and fetching application codes from the non-volatile memory to a volatile memory. The initialization of the hardware is executed by setting the best basic parameters for the hardware. Several of the parameters can be modified after the sale of the portable terminal. As an example of such modification of the parameter, adjustment of processor operation frequency may be considered. In this case, the boot code needs to be downloaded to the portable terminal and to be updated as described above.
However, the power may be cut off before the boot code to be updated is stored in the update area and after the update area is cleared in the course of the updating according to the above procedure. In this case, although storage contents of the update area are copied to the backup area before the clearance of the update area and power is again supplied thereafter, booting itself is not executed, because the area having stored code required for booting has been cleared.
When the boot code is downloaded and updated like this, it may be impossible for the booting to be executed after the booting has been stopped by abnormal causes in the course of the updating, unlike the update of other software, such as application programs, fonts binaries, contents binaries, etc. In such a case, although the power is again normally supplied thereafter, it goes without saying that the stopped updating of the boot code cannot be continued, and even the booting cannot be executed, and in the long run the portable terminal cannot be used.